﻿@model NC.Core.Models.AccountUser

@{
    Layout = null;
    
}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="favicon.png">

    <title>Nepali Corner</title>

    <!-- Bootstrap core CSS -->
    <link href="@Url.Content("~/Content/css/bootstrap.min.css")" rel="stylesheet">

    <!-- Custom styles for this template -->
	 <link href="@Url.Content("~/Content/css/preview.css")" rel="stylesheet">
    <link href="@Url.Content("~/Content/css/mystyle.css")" rel="stylesheet">
  
    <script src="@Url.Content("~/Scripts/js/modernizr.js")" type="text/javascript"></script>
  </head>

  <body class="eternity-form  colorBg3 colorBg colorBg6 " >
    <div class="navbar navbar-fixed-top navbar-inverse " role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="@Url.Action("Index")">NepCorner</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
             <li><a href="#about">About</a></li>
              <li>@Html.ActionLink("Create Post", "CreatePost", "NepaliCorner")</li>
            <li><a href="#contact">Contact</a></li>
          </ul>
          <ul class="nav navbar-nav pull-right">
          <li >@Html.ActionLink("LOGIN", "GetLogInPage", "NepaliCorner")</li>
                     <li>@Html.ActionLink("SIGNUP", "RegisterAccount", "NepaliCorner")</li>
                     </ul>
        </div><!-- /.nav-collapse -->
      </div><!-- /.container -->
    </div><!-- /.navbar -->

    <div class="container">
	 <section class="colorBg " id="loginBox">
        <div class=" container">

         @if(ViewBag.message!=null)
                       {
                      <div class="alert alert-success alert-dismissable">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  @ViewBag.message
</div>
                       }
                       
                       @if (ViewBag.ResetSuccess!=null)
                       {
                         <div class="alert alert-success alert-dismissable">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  @ViewBag.ResetSuccess
</div>
                       }

            <div class="login-form-section">
                <div class="login-content bounceIn" >
                   @using (Html.BeginForm("UpdateResetPassword", "NepaliCorner"))
                   {
                      
                        <div class="section-title">
                            <h3>Reset Password</h3>
                        </div>
                       <div class="textbox-wrap" id="ValidPassContainer">
                                    <div class="input-group">
                                        <span class="input-group-addon glyphicon glyphicon-lock "></span>
                                 @Html.PasswordFor(model => model.Password, new { @class = "form-control", @placeholder = "New Password", @required = "required", @id = "txtresetpass" })
                                    </div>
                                     <label class="control-label" id="lblvalidpass" for="inputError" style="display:none;">Your password should of length in between 6-20 and must contain at least 1 letter and 1 digit</label>
                                   @if (ViewBag.Notmatch != null)
                                   { 
                                    <div class="alert alert-warning alert-dismissable">
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                             @ViewBag.Notmatch
                       </div>
                                   }
                                </div>
                                <div id="passchkContainer" class="textbox-wrap">
                                    <div class="input-group">
                                        <span class="input-group-addon  glyphicon glyphicon-lock "></span>
                                      <input type="password" class="form-control " placeholder="Confirm-Password" required="required" name="cresetpass" id="txtcresetpass"/>
                                    
                                           </div>
                                           <label class="control-label" id="lblerror" for="inputError" style="display:none;">Password Mismatch</label>
                                            <label class="control-label" id="lblsuccess" for="inputError" style="display:none;">Password Matched</label>
                                            </div>
                                             
                        <div class="login-form-action clearfix">
                          
                            <button type="submit" class="btn btn-success pull-right blue-btn">Reset Password &nbsp; <span class="glyphicon glyphicon-chevron-right"></span></button>
                        </div>
                   }
                </div>
               
                          </div>



        </div>
    </section>
	  <script src="@Url.Content("https://code.jquery.com/jquery-1.10.2.min.js")"></script>
    <script src="@Url.Content("~/Scripts/js/bootstrap.min.js")"></script>
    <script src="offcanvas.js"></script>
    <script src="@Url.Content("~/Scripts/js/jquery-1.9.1.js")"></script>
    <script src="@Url.Content("~/Scripts/js/bootstrap.js")"></script>
    <script src="@Url.Content("~/Scripts/js/respond.src.js")"></script>
    <script src="@Url.Content("~/Scripts/js/jquery.icheck.js")"></script>
    <script src="@Url.Content("~/Scripts/js/placeholders.min.js")"></script>
    <script src="@Url.Content("~/Scripts/js/waypoints.min.js")"></script>
    <script src="@Url.Content("~/Scripts/js/jquery.panelSnap.js")"></script>

     <script type="text/javascript">
         $(function () {
             $("#txtresetpass").keyup(function () {
                 var exp = /^(?=.*\d)(?=.*[a-zA-Z]).{6,20}$/;
                 var pass = $(this).val();
                 if (!exp.test(pass)) {
                     $("#ValidPassContainer").removeClass("has-success");
                     $("#ValidPassContainer").addClass("has-error");
                     $("#ValidPassContainer label#lblvalidpass").fadeIn();
                     $("#txtcresetpass").attr("disabled", true);
                     $("#registerSubmit").attr("disabled", true);
                 }
                 else {
                     $("#ValidPassContainer").addClass("has-success");
                     $("#ValidPassContainer label#lblvalidpass").fadeOut();
                     $("#txtcresetpass").attr("disabled", false);
                     $("#registerSubmit").attr("disabled", false);
                 }
             });
             $("#txtcresetpass").keyup(function () {
                 if ($("#txtresetpass").val() == "" || $(this).val() == "") {
                     $("#passchkContainer label#lblerror").fadeOut();
                     $("#passchkContainer label#lblsuccess").fadeOut();
                     $("#registerSubmit").attr("disabled", true);

                 }
                 else if ($("#txtresetpass").val() == $(this).val()) {
                     $("#passchkContainer").addClass("has-success");
                     $("#passchkContainer label#lblsuccess").fadeIn();
                     $("#passchkContainer label#lblerror").fadeOut();
                     $("#registerSubmit").attr("disabled", false);

                 } else {
                     $("#passchkContainer").addClass("has-error");
                     $("#passchkContainer label#lblerror").fadeIn();
                     $("#passchkContainer label#lblsuccess").fadeOut();
                     $("#registerSubmit").attr("disabled", true);
                     //alert("Password Mismatch");
                 }
             });



         });
    </script>

</div>
</body>

